	
	'
	'  simple app for testing FB.RegExpLib.Preprocessor
	'
	
	#Include "..\src\fbregexp.bas"
	
	Dim As String regexp, mulln, icase, again
	
	Dim As FB.RegExpLib.Preprocessor preproc
	
	Do
		
		Print "----------------------------"
		Print
		Line Input "Enter a regular expression: ", regexp
		Input "Set Multiline flag (y/n)"; mulln
		Input "Set IgnoreCase flag (y/n)"; icase
		Print
		
		If preproc.Preprocess(regexp, LCase(Left(mulln, 1)) = "y", LCase(Left(icase, 1)) = "y") Then
			Print "Preprocessed expression:"
			Print
			Print "  "; regexp
		Else
			Print "Error: "; preproc.ErrorDescription
		EndIf
		
		Print
		Print
		Input "Continue (y/n)"; again
		
		If LCase(Left(again, 1)) <> "y" Then Exit Do
		
		Print
		Print
		
	Loop
